
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>注册新用户</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="http://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="http://v3.bootcss.com/examples/signin/signin.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">

      <form class="form-signin" method="post" action="./zhuce.php">
        <h2 class="form-signin-heading">新用户注册</h2>
        <label for="inputEmail" class="sr-only">nikename</label>
        <input type="text" name="nikename" class="form-control" placeholder="nikename">
        <label for="inputEmail" class="sr-only">name</label>
        <div>
          <input type="text" name="username" class="form-control" placeholder="Name" id="username">
          <p class="info"></p>
        </div>
        
        <label for="inputPassword" class="sr-only">Password</label>
        <input type="password" id="inputPassword" name="password" class="form-control" placeholder="Password" required>
        <label for="inputPassword" class="sr-only">querenPassword</label>
        <input type="password" id="inputPassword" name="pass" class="form-control" placeholder="确认密码" required>
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> 同意用户协议
          </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">注册</button>
        <a href="./index.php" class="btn btn-lg btn-primary btn-block">返回首页</a>
      </form>

    </div> <!-- /container -->


    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  
    <script type="text/javascript">
    $(function  () {
      $('#username').blur(function(event) {
        var username = $(this).val();
        var objthis = $(this);
        $.ajax({
          url: './ajaxzhuche.php',
          type: 'POST',
          dataType: 'json',
          data: {username: username},
        })
        .done(function(data) {
          if (data.error==1) {
            objthis.siblings('.info').html('<i class="glyphicon glyphicon-remove" style="color:red;"></i>'+data.info);
          }else{
            objthis.siblings('.info').html('<i class="glyphicon glyphicon-ok" style="color:green;"></i>'+data.info);
          }
        })
        .fail(function() {
          alert('fail');
        })
        





      });
        
      






    })
    </script>
  </body>
</html>
